<%@page import="java.sql.Connection"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="com.connection.jdbconnection"%>
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<style type="text/css">

#font1{

color: black;


}


</style>


</head>



<body>
	<form>
		<%
			/*  String sid;
			 String sname;
			String fname; 
			 String dob;
			 String address;
			 String course;
			 String issuedate;
			 String validuntile */;

			Statement st;
			ResultSet rs;
			Connection con = null;
			String name = request.getParameter("name");
			String sign = null;

			try {
				jdbconnection db = new jdbconnection();
				st = db.jdbConnection();

				String q = "select * from adminprofile";
				System.out.println(q);
				ResultSet rs1 = st.executeQuery(q);
				if (rs1.next()) {
					sign = rs1.getString(5);
				}

				String sql = "select * from register where status='" + 1 + "'";
				System.out.println(sql);
				rs = st.executeQuery(sql);

				int count = 0;
				while (rs.next()) {
					count++;
				}

				float pages = count / 8.0f;

				int d = (int) Math.ceil(pages);
				rs.beforeFirst();
		%>

		<a href="javascript: window.print();">Print</a>

		<%
			for (int j = 1; j <= d; j++) {
		%>

		<div
			style="margin-top: 20px; margin-bottom: 40px; width: 900px; height: 1070px; border-style: groove;">
			<%
				int i = 1;

						while (rs.next()) {

							String eid = rs.getString(1);
							String ename = rs.getString(2);
							String econtact = rs.getString(7);
							String edoj = rs.getString(9);
							String photo = rs.getString(10);
			%>
			<div
				style="width: 280px; height: 342px; border-style: groove; float: left; margin-bottom: 10px; margin-left: 7px; margin-top: 2px;">

				<div style="width: 280px; height: 100px;">
					<img alt="image" src="images/logo1.jpg" height="100px;"
						width="100%" /> <font color="black"
						style="font-family: serif; font-style: normal; text-shadow: purple; font-size: 32px; width: 100%; margin-left: 100px;"><b><u></u>
					</b></font><br> <font size="4px" style="margin-left: 60px;"><b></b>
						<br> </font>
					<div
						style="width: 100px; height: 120px; border-style: groove; margin-left: 5px; margin-top: -40px;">
						<img src="<%=photo%>" alt="image"
							style="width: 100px; height: 120px;" />
					</div>

				</div>
				<hr
					style="width: 165px; height: 1px; background-color: black; margin-left: 111px; margin-top: 2px;">
				<div
					style="background: url('images/logo21.jpg') no-repeat; height: 245px;">
					<font style="margin-left: 140px;"><b><u>Employee ID
								Card</u></b></font>
					<div
						style="border-color: black; border: 2px; height: 190px; margin-left: 120px; margin-top: 10px;">

						<div
							style="float: left; margin-left: 0px; width: 130px; border: 2px;">
							<font color="purple" style="font-size: 16px;"><b> ID:&nbsp;<font id="font1"> <%=eid%></font><br>
									Name:&nbsp;<font id="font1"><%=ename%></font><br> Contact:&nbsp;<font id="font1"><%=econtact%></font> <br> D.O.J:&nbsp;<font id="font1"><%=edoj%></font><br>
							</b> </font>

</div>

						</div>

						
							<div
								style="width: 150px; height: 20px; margin-left: 96px; margin-top: -132px;">
								<br><br><br><br>
								<img src="<%=sign%>" alt="image" height="20px" width="100px" />
								<br> <font color="black" style="font-size: 16px;"><b>Auth.
										Signature</b></font>
							</div>


						


					


				</div>
			</div>
			<%
				if (i == 8)
								break;

							i++;
						}
			%>

		</div>



		<%
			}
			} catch (Exception e) {
				e.printStackTrace();
			}
		%>




	</form>



</body>
</html>
